import {reactive} from "vue";


function useFourCorner(viewportIds: string[]) {
    let cornerVal

    function initFourCorner() {
        const rawCornerVal = {}
        let temp = {}
        viewportIds.forEach(viewportId => {
            temp[viewportId] = Object.assign({}, rawCornerVal)
        })
        cornerVal = reactive(temp)
    }

    initFourCorner()

    function updateCornerVal(viewPortId, obj) {
        Object.assign(cornerVal[viewPortId], obj)
    }

    return {
        cornerVal,
        updateCornerVal
    }
}

export {
    useFourCorner
}
